Optimal. Leaf size=72 \[ \frac {\tanh ^{-1}(\cos (c+d x))}{2 a d}-\frac {\cot (c+d x)}{a d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {\cot (c+d x) \csc (c+d x)}{2 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {2918, 3852,
3853, 3855} \begin {gather*} -\frac {\cot ^3(c+d x)}{3 a d}-\frac {\cot (c+d x)}{a d}+\frac {\tanh ^{-1}(\cos (c+d x))}{2 a d}+\frac {\cot (c+d x) \csc (c+d x)}{2 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2918
Rule 3852
Rule 3853
Rule 3855
Rubi steps
\begin {align*} \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx &=-\frac {\int \csc ^3(c+d x) \, dx}{a}+\frac {\int \csc ^4(c+d x) \, dx}{a}\\ &=\frac {\cot (c+d x) \csc (c+d x)}{2 a d}-\frac {\int \csc (c+d x) \, dx}{2 a}-\frac {\text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (c+d x)\right )}{a d}\\ &=\frac {\tanh ^{-1}(\cos (c+d x))}{2 a d}-\frac {\cot (c+d x)}{a d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {\cot (c+d x) \csc (c+d x)}{2 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.48, size = 126, normalized size = 1.75 \begin {gather*} -\frac {\csc \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (\csc \left (\frac {1}{2} (c+d x)\right )+\sec \left (\frac {1}{2} (c+d x)\right )\right )^2 \left (-12 \cos (c+d x) (-1+\sin (c+d x))-4 \left (\cos (3 (c+d x))+3 \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin ^3(c+d x)\right )\right )}{192 a d (1+\sin (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.22, size = 96, normalized size = 1.33
method | result | size |
derivativedivides | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {3}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {1}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}}{8 d a}\) | \(96\) |
default | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {3}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {1}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}}{8 d a}\) | \(96\) |
risch | \(-\frac {3 \,{\mathrm e}^{5 i \left (d x +c \right )}-12 i {\mathrm e}^{2 i \left (d x +c \right )}+4 i-3 \,{\mathrm e}^{i \left (d x +c \right )}}{3 a d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 a d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 a d}\) | \(100\) |
norman | \(\frac {-\frac {1}{24 a d}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{12 a d}-\frac {\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d}+\frac {\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d}-\frac {\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )}{12 a d}+\frac {\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )}{24 a d}-\frac {3 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a d}\) | \(166\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 153 vs.
\(2 (66) = 132\).
time = 0.29, size = 153, normalized size = 2.12 \begin {gather*} \frac {\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a} - \frac {12 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {{\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {9 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{3}}{a \sin \left (d x + c\right )^{3}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 119, normalized size = 1.65 \begin {gather*} -\frac {8 \, \cos \left (d x + c\right )^{3} - 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 6 \, \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 12 \, \cos \left (d x + c\right )}{12 \, {\left (a d \cos \left (d x + c\right )^{2} - a d\right )} \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cos ^{2}{\left (c + d x \right )} \csc ^{4}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 128, normalized size = 1.78 \begin {gather*} -\frac {\frac {12 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} - \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{3}} - \frac {22 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1}{a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.62, size = 119, normalized size = 1.65 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,a\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,a\,d}+\frac {3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,a\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {1}{3}\right )}{8\,a\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________